iT邦幫忙

0

DEX也是香港中文大學發展的,它建立在SurRoL之上,跟SurRoL一樣,如果沒用dVRK硬體,不須裝dVRK.但他是用pytorch而非tensorflow

git clone --recursive https://github.com/med-air/DEX.git
cd DEX

conda create -n dex python=3.8
conda activate dex

cd SurRoL
pip3 install click #缺這
pip3 install -e .
# pip3 install -e SurRoL/	# install surrol environments
pip3 install -r requirements.txt #torch不是tensorflow
pip3 install -e .

然後要在anaconda3/envs/dex/lib/python3.8/site-packages/gym/envs/init.py加入一行(不知道網頁為何重複2次gym)

import surrol.gym

範例是

mkdir SurRoL/surrol/data/demo
python SurRoL/surrol/data/data_generation.py --env NeedlePick-v0 

Yes
範例共195秒

如果要項網頁上自己訓練看看,須先把~/DEX/dex/configs/traing.yaml中的第27行的entity_name: thuang22改成自己在wandb.ai中的名子,然後再執行training. 而~/DEX/dex/configs/eval.yaml也是

#Train DDPG with 4 parallel training processes:
start=$(date "+%s")
#do something
mpirun -np 4 python -m train agent=ddpg task=NeedlePick-v0 use_wb=True #device=cpu
now=$(date "+%s")
time=$((now-start))
echo " DDPG with 4 parallel training processes training time used:$time seconds" >> ./output

https://ithelp.ithome.com.tw/upload/images/20230723/201572746CNgHUXlzk.png
https://ithelp.ithome.com.tw/upload/images/20230723/20157274QAt2eyrs1x.png

效果沒有demo的好

Yes
https://ithelp.ithome.com.tw/upload/images/20230723/20157274z8nTHVKo3w.png
https://ithelp.ithome.com.tw/upload/images/20230723/20157274BcR1FdI1yz.png

python3 ~/DEX/eval.py task=NeedlePick-v0 agent=ddpg ckpt_episode=~/DEX/exp_local/NeedlePick-v0/DDPG/d100/s1/model/weights_ep1600.pth

https://ithelp.ithome.com.tw/upload/images/20230723/20157274xTH1KPEK9I.png

https://ithelp.ithome.com.tw/upload/images/20230725/20157274ip8gLoPSTQ.png

p.s.裝完DEX,在DEX/SurRoL/surrol/tasks/下的都可以跑,不用裝SurRoL
p.s.2 剛開始沒有GPU卡,我無法跑訓練,會出現failed to EGL with glad.我有請教作者,他說可以試試加上 device=cpu,但我發覺沒用.只好買一張rtx 4060/images/emoticon/emoticon02.gif,而且CUDA,cuDNN好難裝/images/emoticon/emoticon20.gif


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言